
function emp_edit(form) {

	if (!confirm("确认是否提交？")) {
		return false;
	}

	var body = {};
	body.engname = form.engname.value;
	body.nationality = form.nationality.value;
	body.education = form.education.value;

	body.marriage = form.marriage.value;

	body.mobile = form.mobile.value;
	
	body.urgent = form.urgent.value;
	body.jj = form.jj.value;
	body.content = form.content.value;

	var url = 'resume.php?do=Resume.editPost';

	$.post(url, body, function(data) {
		alert("提交成功！");
	});
}

var Education = {

	popup: function (e, p2, id) {
		$.cookie('id_', id);

		p2 = query(p2);
		$.cookie('p2', p2);

		var a1 = ['编辑信息', 'url', 'Education.dialog_edit_', '550x320', '编辑信息'];
		var a2 = ['查看信息', 'url', 'Common.dialog_view_', '550x320', '查看信息'];
		
		var c1 = 'resume.php?do=Education.edit&id=' + id;
		var c2 = 'resume.php?do=Education.view&id=' + id;

		var s = c1 + ", " + c2;

		popup(e, [a1, a2], s);
	},
	
	dialog_add_: function (url, title, xy) {
		var result = Common.result();
		$('#dialog_add').dialog('option', 'buttons', {			
			"关闭": function() {
				$(this).dialog("close");
			},
	
			"添加": function() {
				if (!confirm("确认是否提交？")) {
					return false;
				}
					
				var form = $("#form_add")[0];
	
				var body = { };
				body.t1 = form.t1.value;
				body.t2 = form.t2.value;
	
				body.school = form.school.value;
				body.address = form.address.value;
				
				body.profession = form.profession.value;
				body.degree = form.degree.value;
				
				$(this).dialog("close");
	
				$.post('resume.php?do=Education.addPost', body, function(data) {
					$(result).html(data);
				});
			}
		});
	
		dialog_add(url, title, xy);
	}, 

	dialog_edit_: function (url, title, xy) {
		var result = Common.result();
		$('#dialog_edit').dialog('option', 'buttons', {			
			"关闭": function() {
				$(this).dialog("close");
			},
	
			"修改": function() {
				if (!confirm("确认是否提交？")) {
					return false;
				}
	
				var form = $("#form_edit")[0];
	
				var body = {};
				body.id = form.id.value;
				body.t1 = form.t1.value;
				body.t2 = form.t2.value;
	
				body.school = form.school.value;
				body.address = form.address.value;
				
				body.profession = form.profession.value;
				body.degree = form.degree.value;
	
				$(this).dialog("close");
	
				var url = 'resume.php?do=Education.editPost';
				var p2 = $.cookie('p2');
				if (p2 != null) {
					url += p2;
				}
	
				$.post(url, body, function(data) {
					$(result).html(data);
				});
			}
		});
	
		dialog_edit(url, title, xy);
	}
};

var Family = {

	popup: function (e, p2, id) {
		$.cookie('id_', id);

		p2 = query(p2);
		$.cookie('p2', p2);

		var a1 = ['编辑信息', 'url', 'Family.dialog_edit_', '550x320', '编辑信息'];
		var a2 = ['查看信息', 'url', 'Common.dialog_view_', '550x320', '查看信息'];

		var c1 = 'resume.php?do=Family.edit&id=' + id;
		var c2 = 'resume.php?do=Family.view&id=' + id;

		var s = c1 + ", " + c2;

		popup(e, [a1, a2], s);
	},
	
	dialog_add_: function (url, title, xy) {
		var result = Common.result();	
		$('#dialog_add').dialog('option', 'buttons', {			
			"关闭": function() {
				$(this).dialog("close");
			},
	
			"添加": function() {
				if (!confirm("确认是否提交？")) {
					return false;
				}
					
				var form = $("#form_add")[0];
	
				var body = { };
				body.name = form.name.value;
				body.relative = form.relative.value;
	
				body.address = form.address.value;
				body.job = form.job.value;
	
				body.tel = form.tel.value;
				
				$(this).dialog("close");
	
				$.post('resume.php?do=Family.addPost', body, function(data) {
					$(result).html(data);
				});
			}
		});
	
		dialog_add(url, title, xy);
	}, 

	dialog_edit_: function (url, title, xy) {
		var result = Common.result();
		$('#dialog_edit').dialog('option', 'buttons', {			
			"关闭": function() {
				$(this).dialog("close");
			},
	
			"修改": function() {
				if (!confirm("确认是否提交2222？")) {
					return false;
				}
	
				var form = $("#form_edit")[0];
	
				var body = {};
				body.id = form.id.value;				
				body.name = form.name.value;				
				body.relative = form.relative.value;	
				body.address = form.address.value;
				body.job = form.job.value;	
				body.tel = form.tel.value;				
	
				$(this).dialog("close");
	
				var url = 'resume.php?do=Family.editPost';
	
				$.post(url, body, function(data) {
					$(result).html(data);
				});
			}
		});
	
		dialog_edit(url, title, xy);
	}
};

var Work = {

	popup: function (e, p2, id) {
		$.cookie('id_', id);

		p2 = query(p2);
		$.cookie('p2', p2);

		var a1 = ['编辑信息', 'url', 'Work.dialog_edit_', '550x320', '编辑信息'];
		var a2 = ['查看信息', 'url', 'Common.dialog_view_', '550x320', '查看信息'];
		
		var c1 = 'resume.php?do=Work.edit&id=' + id;
		var c2 = 'resume.php?do=Work.view&id=' + id;
		
		var s = c1 + ", " + c2;

		popup(e, [a1, a2], s);
	},
	
	dialog_add_: function (url, title, xy) {
		var result = Common.result();
		$('#dialog_add').dialog('option', 'buttons', {			
			"关闭": function() {
				$(this).dialog("close");
			},
	
			"添加": function() {
				if (!confirm("确认是否提交？")) {
					return false;
				}
					
				var form = $("#form_add")[0];
	
				var body = { };
				body.t1 = form.t1.value;
				body.t2 = form.t2.value;
				
				body.company = form.company.value;
				body.job = form.job.value;
	
				body.tel = form.tel.value;
				body.reason = form.reason.value;
				
				$(this).dialog("close");
	
				$.post('resume.php?do=Work.addPost', body, function(data) {
					$(result).html(data);
				});
			}
		});
	
		dialog_add(url, title, xy);
	},

	dialog_edit_: function (url, title, xy) {
		var result = Common.result();
		$('#dialog_edit').dialog('option', 'buttons', {			
			"关闭": function() {
				$(this).dialog("close");
			},
	
			"修改": function() {
				if (!confirm("确认是否提交？")) {
					return false;
				}
	
				var form = $("#form_edit")[0];
	
				var body = {};
				body.id = form.id.value;
				body.t1 = form.t1.value;
				body.t2 = form.t2.value;
				
				body.company = form.company.value;
				body.job = form.job.value;
	
				body.tel = form.tel.value;
				body.reason = form.reason.value;
	
				$(this).dialog("close");
	
				var url = 'resume.php?do=Work.editPost';
	
				$.post(url, body, function(data) {
					$(result).html(data);
				});
			}
		});
	
		dialog_edit(url, title, xy);
	}
};
